# 集成测试报告

# 导包
import time
import unittest
from scripts.test01_login import TestLoginAPI
from lib.HTMLTestRunner import HTMLTestRunner

# 封装测试套件
suite = unittest.TestSuite()
suite.addTest(unittest.makeSuite(TestLoginAPI))
# 指定测试报告路径
report = "./report/report-{}.html".format(time.strftime("%Y%m%d-%H%M%S"))
# 以文件流形式打开文件
with open(report,"wb") as f:
    # 创建HTMLRunner的运行器
    runner = HTMLTestRunner(f,title="接口测试报告")
    # 执行测试套件
    runner.run(suite)